# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
# filename:     Makefile/filemanagement
# copyright:    changhong electric co., ltd
# brief:        文件管理模块Makefile文件
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Rev   Date        Author          Comments
# 1     2009-10-10  qingsong.li     Create
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
CROSS_COMPILE = NO

ifeq ($(CROSS_COMPILE), YES)
export PATH    := /opt/tuxbuilder-1.0/mipsel-unknown-linux-gnu/cross/bin:$(PATH)
BUILD_ROOT     := /opt/stb225
INCLUDEDIR     := $(BUILD_ROOT)/build_full/packages/buildroot-20080521/build_mipsel/DirectFB-1.0.0_nxp/include/
LIBDIR         := $(BUILD_ROOT)/build_full/rootfs/usr/lib
COMPILE_PREFIX := mipsel-linux-
else
INCLUDEDIR     := /usr/include/directfb
endif

CC  := $(COMPILE_PREFIX)gcc
CXX := $(COMPILE_PREFIX)g++
LD  := $(COMPILE_PREFIX)ld
AR  := $(COMPILE_PREFIX)ar

CFLAGS  += -g -Wall -I$(INCLUDEDIR)
LDFLAGS += -L$(LIBDIR) -lz -ldirect -ldirectfb -lpthread -lfusion

#编译规则
C_SOURCES := $(wildcard   *.c )
C_OBJS    := $(patsubst %.c,%.o,$(C_SOURCES))

.PHONY : all clean
all : $(C_OBJS)
	$(CC) $(LDFLAGS) $^ -o a.out

%.o: %.c
	$(CC) -c $<  $(CFLAGS) -o $@

clean :
	rm -rf *.o *~ all a.out

install :
	cp a.out /home/chinsung/nfs/